#!/usr/bin/env python

def _(s): return s

import sys, wx

class Close:
    def __init__(self, mainWin):
        if mainWin.fileSaved or \
            UserMessage.ask(_("There are unsaved changes. Close anyway?"),
                          _("Are you sure?")) == wx.ID_YES:
            if hasattr(mainWin, "sites"):
                mainWin.sites.Destroy()
                del mainWin.sites
            mainWin.currentFile = None
            mainWin.SetTitle("Athabaskan")
            mainWin.enableMenuItems([50], False)